#pragma once
#include <d3d9.h>
#include <dinput.h> 

class Game;

class CInput
{
private:
    HWND window; 
    IDirectInput8 *di; 
    IDirectInputDevice8 *keyboard;
    char keyState[256];
    IDirectInputDevice8 *mouse; 
    DIMOUSESTATE mouseState; 
    POINT position; 

public:
    CInput( HWND window );
    virtual ~CInput();
    void Update();
	void SendEvents(Game* pGame);
    bool GetMouseButton( char button );

    char GetKeyState(int key) { return keyState[key]; }
    long GetPosX() { return position.x; }
    long GetPosY() { return position.y; }
    long GetDeltaX() { return mouseState.lX; }
    long GetDeltaY() { return mouseState.lY; }
    long GetDeltaWheel() { return mouseState.lZ; }
};